 package net.kunyv.DAL;

 import net.kunyv.entity.DaoEntity;
import net.kunyv.entity.DbConfig;
import net.kunyv.entity.EntityColumn;
import net.kunyv.factory.DataSourceStrategyFactory;

import java.util.List;

public class GenEntityBean
 {
  private String[] colnames;
  private DbSession db;

  public DbSession getDb() { return this.db; }


   public void setDb(DbSession db) { this.db = db; }



   public List<EntityColumn> GenBean(DbConfig dbconfig, DaoEntity de) throws Exception {
     try {
       String databaseName = de.getDatabaseName();

       InitBean initBean = DataSourceStrategyFactory.getBySqlType(databaseName);
      return initBean.init(dbconfig, de);
     }
     catch (Exception ex) {
       ex.printStackTrace();


      return null;
     }
  }
}
